const http = require('http')
const fs = require('fs')

const server = http.createServer((req,res)=>{
    let path =  req.url
    let filePath = './sucai'+ path + "index.html"
    console.log(filePath);
    let w = fs.readFile(filePath,(err,data)=>{
        if(err){
            res.end('Not Found 404')
        }
        res.end(data)
    })
    
  
    
})

server.listen(3000,()=>{
    console.log("服务器启动成功");
})